package ui.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import tree.PageTree;
import util.Util;

/**
 * Imports SGF problem into current page.
 * @author TKington
 *
 */
public class ImportSGFAction extends AbstractAction {
	/**
	 * Creates an ImportSGFAction.
	 */
	public ImportSGFAction() {
		putValue(NAME, "ImpSGF");
		putValue(SHORT_DESCRIPTION, "Import Go Problem (SGF file)");
		//putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
		putValue(SMALL_ICON, Util.getIcon("Import16.gif")); //$NON-NLS-1$
	}
	
	public void actionPerformed(ActionEvent evt) {
		PageTree tree = PageTree.instance();
		tree.getSelectedPage().importSGF(null);
	}
}